package com.iran.decorator.example;

public abstract class Decorator implements DecorateComponent {

    protected DecorateComponent decorateComponent;

    public void setDecorateComponent(DecorateComponent decorateComponent) {
        this.decorateComponent = decorateComponent;
    }

    @Override
    public void wearing(Person person) {
        if (decorateComponent!= null){
            decorateComponent.wearing(person);
        }
    }
}
